package com.zhengxyou.jetpackdemo.room.entity;

import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Index;
import androidx.room.PrimaryKey;

import static androidx.room.ForeignKey.CASCADE;

@Entity(tableName = "user_info",
        indices = {@Index(value = "uid")},
        foreignKeys = {@ForeignKey(entity = User.class, parentColumns = "id", childColumns = "uid", onDelete = CASCADE)})
public class UserInfo {
    @PrimaryKey(autoGenerate = true)
    public int id;
    public String address;
    public String email;
    public String tel;
    public int uid;
}
